var c = Object.defineProperty;
var f = Object.getOwnPropertySymbols;
var d = Object.prototype.hasOwnProperty, v = Object.prototype.propertyIsEnumerable;
var i = (r, n, e) => n in r ? c(r, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[n] = e, a = (r, n) => {
  for (var e in n || (n = {}))
    d.call(n, e) && i(r, e, n[e]);
  if (f)
    for (var e of f(n))
      v.call(n, e) && i(r, e, n[e]);
  return r;
};
import { shallowReactive as m, getCurrentInstance as x, provide as y, markRaw as p } from "vue";
/*!
* Vin UI 移动端 Vue3 组件库 v0.2.9 Fri Jun 02 2023 21:01:02 GMT+0800 (中国标准时间)
* (c) 2023 @vingogo.
* Released under the MIT License.
*/
function b(r) {
  return r ? r.__v_isVNode === !0 : !1;
}
function T(r, n) {
  const e = [], s = (u) => {
    Array.isArray(u) && u.forEach((t) => {
      var o;
      if (b(t)) {
        if (n) {
          if (t.type && t.type.name === n) {
            e.push(t);
            return;
          }
        } else
          e.push(t);
        (o = t.component) != null && o.subTree && s(t.component.subTree.children), t.children && s(t.children);
      }
    });
  };
  return s(r), e;
}
function C(r, n, e) {
  const s = T(r && r.subTree && r.subTree.children, e);
  n.sort((u, t) => s.indexOf(u.vnode) - s.indexOf(t.vnode));
}
function _(r, n) {
  const e = m([]), s = x(), u = (o) => {
    o.proxy && (e.push(p(o)), C(s, e, n));
  }, t = (o) => {
    e.splice(e.indexOf(p(o)), 1);
  };
  return (o) => (y(r, a({
    add: u,
    remove: t,
    internalChildren: e
  }, o)), {
    internalChildren: e
  });
}
export {
  _ as u
};
